<?php

function reply_to_get_status($id) {
	$status = array();
	$pres = db_array('SELECT reply_stat FROM status WHERE stat_id = '.$id);
	foreach ($pres as $pre) {
		$statuses = db_array('SELECT stat_id,stat_date,stat_txt,reply_stat,restat_from,user_id,username,name FROM status INNER JOIN users ON stat_user = user_id WHERE stat_id = '.$pre['reply_stat']);
		$statuses = extend_statuses($statuses);
	}
	return $statuses;
}

if (defined('NO_DIRECT')) {
	if (isset($_GET['i'])) { // stat_id itu yang mana status itu reply
		if (isset($_GET['ajax'])) {
			header('Content-type: text/plain');
			$statuses = reply_to_get_status(intval($_GET['i']));
			echo json_encode($statuses);
		} else {
			$post = get_posts($session['user']['user_id']);
			$following = get_followings($session['user']['user_id']);
			$follower = get_followers($session['user']['user_id']);
			$statuses = reply_to_get_status(intval($_GET['i']));
		}
	}
}